package ch.abcm.remsmobile.REMSMobile.orm.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import ch.bfh.abcm.rems.gateway.GateWayMessageType;

@DatabaseTable(tableName="treshholds")
public class Treshhold {
	@DatabaseField(generatedId = true)
	int id;
	@DatabaseField
	GateWayMessageType gateWayMessageType;
	@DatabaseField
	long timeout;
	@DatabaseField
	long timestampLastMessage;

	public Treshhold() {
	}

	public Treshhold(GateWayMessageType gateWayMessageType, long timeout, long timestampLastMesssage) {
		this.gateWayMessageType = gateWayMessageType;
		this.timeout = timeout;
		this.timestampLastMessage = timestampLastMesssage;
	}

	public GateWayMessageType getGateWayMessageType() {
		return gateWayMessageType;
	}

	public void setGateWayMessageType(GateWayMessageType gateWayMessageType) {
		this.gateWayMessageType = gateWayMessageType;
	}

	public long getTimeout() {
		return timeout;
	}

	public void setTimeout(long timeout) {
		this.timeout = timeout;
	}

	public long getTimestampLastMessage() {
		return timestampLastMessage;
	}

	public void setTimestampLastMessage(long timestampLastMessage) {
		this.timestampLastMessage = timestampLastMessage;
	}

	@Override
	public String toString() {
		return "Treshhold [id=" + id + ", gateWayMessageType=" + gateWayMessageType + ", timeout=" + timeout
				+ ", timestampLastMessage=" + timestampLastMessage + "]";
	}
}
